import request  from "../utils/request";
//用户登录
export function login(data){
    return request({
        url:'/login',
        method:'post',
        data:{
            "phone":data.username,
            "password":data.password,
            "code":data.code
        }
        
    })
}
//添加用户信息
export function addUser(data){
    return request({
        url:'/user',
        method:'post',
        data:data
    })
}
//修改用户信息
export function updateUser(data){
    return request({
        url:'/user',
        method:'put',
        data:data
    })
}
//删除用户信息
export function deleteUser(id){
    return request({
        url:'/user/'+id,
        method:'delete'
        
    })
}
//获取用户信息
export function getUserList(data){
    return request({
        url:"/user",
        method:'get',
        params:{"currentPage":data.currentPage,"pageSize":data.pageSize}
        
    })
}

// 批量删除用户
export const batchDeleteUser = (ids) => {
  return request({
    url: '/user/batch',
    method: 'delete',
    data: ids // 使用data传递数组数据
  })
}
